console.log("loading init.js");
var VCT = new Vectrite.Instance($("#canvas1")[0].getContext("2d"));

VCT.addStyle({n:"black", func:function(context) { context.fillStyle = "black"; }});
VCT.addStyle({n:"red", func:function(context) { context.fillStyle = "red"; }});

VCT.addVrite(
   {
      n: "stickFigure",
      a: {
         stand: [
            [{c:'s', s:["black"]}, {c:'b'}, {c:'e', p:[0,0,10,10]}, {c:'f'}, {c:'s', s:["red"]}, {c:'b'}, {c:'e', p:[10,0,10,10]}, {c:'f'}],
            [{c:'x', x:"jostleL", d:10}],
            [{c:'x', x:"jostleR", d:10}]
            /*[{c:'s', s:["black"]}, {c:'b'}, {c:'e', p:[0,0,9,10]}, {c:'f'}, {c:'s', s:["red"]}, {c:'b'}, {c:'e', p:[9,0,10,10]}, {c:'f'}],
            [{c:'s', s:["black"]}, {c:'b'}, {c:'e', p:[0,0,8,10]}, {c:'f'}, {c:'s', s:["red"]}, {c:'b'}, {c:'e', p:[8,0,10,10]}, {c:'f'}],
            [{c:'s', s:["black"]}, {c:'b'}, {c:'e', p:[0,0,7,10]}, {c:'f'}, {c:'s', s:["red"]}, {c:'b'}, {c:'e', p:[7,0,10,10]}, {c:'f'}],
            [{c:'s', s:["black"]}, {c:'b'}, {c:'e', p:[0,0,6,10]}, {c:'f'}, {c:'s', s:["red"]}, {c:'b'}, {c:'e', p:[6,0,10,10]}, {c:'f'}],*/
         ],
         footdance: [
            [{c:'s', s:["black"]}, {c:'b'}, {c:'m', p:[0, 0]}, {c:'q', p:[5, -10, 30, 0]}, {c:'q', p:[35, 10, 0, 0]}, {c:'m', p:[60, 0]}, {c:'q', p:[55, -10, 30, 0]}, {c:'q', p:[25, 10, 60, 0]}, {c:'f'}],
            [{c:'x', x:"walk", d:30}],
            //[{c:'s', s: ["red"]}, {c:'b'}, {c:'m', p:[0, 0]}, {c:'q', p:[5, -10, 30, 0]}, {c:'q', p:[35, 10, 0, 0]}, {c:'m', p:[60, 0]}, {c:'q', p:[55, -10, 30, 0]}, {c:'q', p:[25, 10, 60, 0]}, {c:'f'}],
         ]
      },
      t: {
         walk: function(fr) {
         //[{c:'s', s:["black"]}, {c:'b'}, {c:'m', p:[0, 0]}, {c:'q', p:[5, -10, 30, 0]}, {c:'q', p:[35, 10, 0, 0]}, {c:'m', p:[60, 0]}, {c:'q', p:[55, -10, 30, 0]}, {c:'q', p:[25, 10, 60, 0]}, {c:'f'}]
            fr[6].p[0]++;
         },
         //[{c:'s', s:["black"]}, {c:'b'}, {c:'e', p:[0,0,10,10]}, {c:'f'}, {c:'s', s:["red"]}, {c:'b'}, {c:'e', p:[10,0,10,10]}, {c:'f'}],
         jostleL: function(fr) {
            fr[2].p[2]--;
            fr[6].p[0]--;
         },
         jostleR: function(fr) {
            fr[2].p[2]++;
            fr[6].p[0]++;
         }
      }
   },
   "stand",
   50, 50
);

console.log("loaded init.js");